//
//  EditCaogaoCell.m
//  YiqiMobile
//
//  Created by henry on 13-4-26.
//  Copyright (c) 2013年 henry. All rights reserved.
//

#import "EditCaogaoCell.h"
#import "Config.h"
#import "Utility.h"

@implementation EditCaogaoCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UIImageView *bgImgae=[[UIImageView alloc] initWithImage:[Utility imageNamed:@"cg_bg3.png"]];
        bgImgae.frame=self.frame;
        self.backgroundView=bgImgae;
        self.selectButton=[Utility customButton:self action:@selector(selectAction:) normalImage:@"select_normal.png" lightedImage:@"select_hover.png" frame:CGRectZero title:nil tag:0];
        [self addSubview:self.selectButton];
        
            self.contentText=[Utility detailTextLabel:CGRectZero andFontSize:15.0];
            self.contentText.numberOfLines=0;
            self.contentText.textColor=UIColorFromRGB(0x000000);
            [self addSubview:self.contentText];
            
            self.detailText=[Utility detailTextLabel:CGRectZero andFontSize:9.0];
            self.detailText.textColor=UIColorFromRGB(0x666666);
            [self addSubview:self.detailText];
            
            self.statusImage=[[UIImageView alloc] initWithFrame:CGRectZero];
            self.statusImage.image=[Utility imageNamed:@"qznew.png"];
           self.statusImage.hidden=YES;
            [self addSubview:self.statusImage];
        
        UIButton *customButton = [UIButton buttonWithType:UIButtonTypeCustom];
        customButton.frame=CGRectZero;
        self.voiceButton=customButton;
        [self addSubview:self.voiceButton];
        
        // Initialization code
        self.eMAsyncImageView=[[EMAsyncImageView alloc] initWithFrame:CGRectMake(10,12,100,100)];
        [self  addSubview:self.eMAsyncImageView];

    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(IBAction)selectAction:(UIButton*)sender{
    if (self.delegate && [_delegate respondsToSelector:@selector(editSelectActon:andRow:)]) {
        [_delegate  editSelectActon:sender andRow:self.row];
    }
}

@end
